#coding=utf-8
__author__ = 'Meteor'

import  pytest
import time,os
import setings
from mock.mock_option import mock
# 判断是否需要启动mock server
if setings.ISMOCK:
    mock.start_mock()


times = time.strftime('%Y%m%d%H%M%S',time.localtime())
file_name = os.path.join(setings.BASE,'report','%s.html' %times)
pytest.main(['--html=%s' %file_name])

# 判断mock是否已经启动
if mock.start:
    mock.stop()